#if !defined(OPERATING_SYSTEM_HEADER)
#define OPERATING_SYSTEM_HEADER

#include <Windows.h>

#include <cstring>
#include <iostream>

namespace OS {
	typedef HMODULE LibraryHandle;

	class ProjectBase
	{
	public:
		ProjectBase() : canRender_(false) {}
		
		virtual ~ProjectBase() {}

	public:
		virtual bool OnWindowSizeChanged() = 0;
		virtual bool Draw() = 0;

		virtual bool ReadyToDraw() const final
		{
			return canRender_;
		}
	private:
		bool canRender_;
	};

	struct WindowParameters
	{
		HINSTANCE instance;
		HWND handle;

		WindowParameters() : instance(), handle() {}
	};

	class Window
	{
	public:
		Window();
		~Window();

	public:
		bool Create(const char *title);
		bool RenderingLoop(ProjectBase &project) const;
		const WindowParameters GetParameters() const;

	private:
		WindowParameters parameters_;
	};

} // namespace OS

#endif // OPERATING_SYSTEM_HEADER